#pragma once

#include "RedBlackTree.h"

namespace zzh
{
	template<typename K>
	class setKeyOfT
	{
	public:
		const K& operator()(const K& key)
		{
			return key;
		}
	};

	template<typename K>
	class set
	{
	public:
		typedef typename RedBlackTree<K, K, setKeyOfT<K>>::Iterator iterator;
		typedef typename RedBlackTree<K, K, setKeyOfT<K>>::ConstIterator const_iterator;

		iterator begin()
		{
			return _t.begin();
		}

		iterator end()
		{
			return _t.end();
		}

		pair<iterator, bool> insert(const K& key)
		{
			return _t.insert(key);
		}

		void InOrder()
		{
			_t.InOrder();
		}

		bool check()
		{
			return _t.check();
		}

	private:

		RedBlackTree<K, K, setKeyOfT<K>> _t;
	};
}